package com.crm.miaohe.exception;

import lombok.Getter;
import org.springframework.http.HttpStatus;
import org.springframework.web.server.ResponseStatusException;

@Getter
public class ErpBusinessException extends ResponseStatusException {

    private final String code;
    private final Object[] messageParams;

    public ErpBusinessException(HttpStatus status, String code, Object... messageParams) {
        super(status);
        this.code = code;
        this.messageParams = messageParams;
    }

    public ErpBusinessException(HttpStatus status, Throwable e, String code, Object... messageParams) {
        super(status, null, e);
        this.code = code;
        this.messageParams = messageParams;
    }

}
